#include "stm32f10x.h"                  // Device header
#include "Delay.h"
#include "OLED.h"
#include "Encoder.h"
#include "Timer.h"

int main(void)
{
	OLED_Init();
	Encoder_Init();
	Timer_Init();
	OLED_ShowString(1,1,"cnt:");
    OLED_ShowSignedNum(1,5,Encoder_Get(),5);	
	while(1)
	{
		
	}
}

void TIM2_IRQHandler(void)
{
	if(TIM_GetITStatus(TIM2,TIM_IT_Update) == SET )
	{
		Encoder_Tick();
		TIM_ClearITPendingBit(TIM2,TIM_IT_Update);
	}
}

